﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HelloWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
            Point p = e.GetPosition(mainWindow);
            Point p1 = e.GetPosition(mainWindow);

            p.X -= 120;
            p.Y -= 21;

            p1.X -= 180;
            p1.Y -= 21;

            LeftEye.RenderTransform = new RotateTransform(180.0 + (Math.Atan2(p.Y, p.X)/Math.PI)*180.0 );
            RightEye.RenderTransform = new RotateTransform(180.0 + (Math.Atan2(p1.Y, p1.X)/Math.PI)*180.0);
            label1.Content =(int)p.X+";"+(int)p.Y  + " " + p1.X +";"+p1.Y ;
            
        }
    }
}
